package com.smart.common.entities.file;


import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 上传汇编
 *
 * @author 夏绪秋
 * @date 2022-09-27
 */
public class UploadBody {

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ApiModel("UploadBody1")
    public static class Base64 implements Serializable {
        /**
         * base64字符串 需代文件头
         */
        @NotBlank(message = "Base64字符串不能为空")
        private String base64;
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ApiModel("UploadBody2") @Accessors(chain = true)
    public static class ByteFile implements Serializable {

        /**
         * 内容类型
         */
        @NotBlank(message = "文件类型不能为空")
        private String contentType;

        /**
         * 字节数组
         */
        @NotNull(message = "字节内容不能为空")
        private byte[] data;

        @NotNull(message = "上传场景")
        private String since;



        @NotNull(message = "文件前缀")
        String fileNamePrefix;

    }
}
